SRC=redispool.c
OBJ=redispool.o

default : libredispool.a demo redisserver

libredispool.a: $(OBJ)
	ar -ru $(PROJECT_L_DIR)/libredispool.a $(OBJ)
	cp redispool.h $(PROJECT_H_DIR)

demo : demo.c 
	cc -g -o demo demo.c -I$(REDIS_H_DIR) -L$(REDIS_L_DIR) -lhiredis 

redisserver : redisserver.c 
	cc -g -o redisserver redisserver.c -I$(REDIS_H_DIR) -L$(REDIS_L_DIR) -lhiredis

hiredis-example-ae : example-ae.c
	cc -o hiredis-example-ae -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb -I/home/redis-2.4.9/src /home/redis-2.4.9/src/ae.o /home/redis-2.4.9/src/zmalloc.o example-ae.c libhiredis.a ../jemalloc/lib/libjemalloc.a -lpthread -ldl

redispool.o : redispool.c
	cc -g -c redispool.c -I$(REDIS_H_DIR) -I$(PROJECT_H_DIR)

clean:
	rm -f *.o demo redisserver
	rm -f $(PROJECT_L_DIR)/libredispool.a
	rm -f $(PROJECT_H_DIR)/redispool.h
